<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:a="http://richfaces.org/a4j"
                template="layout/template.xhtml">

<ui:define name="body">

    <h:messages globalOnly="true" styleClass="message"/>
    <h:form id="registerActionForm" styleClass="edit">
        <rich:panel>
            <f:facet name="header">LOT new user</f:facet>

            <s:decorate id="firstNameField" template="layout/edit.xhtml">
                <ui:define name="label">First name</ui:define>
                <h:inputText id="firstName" value="#{newUser.firstName}"
                             required="true" />
            </s:decorate>
            <s:decorate id="lastNameField" template="layout/edit.xhtml">
                <ui:define name="label">Last name</ui:define>
                <h:inputText id="lastName" value="#{newUser.lastName}"
                             required="true"/>
            </s:decorate>
            <s:decorate id="emailField" template="layout/edit.xhtml">
                <ui:define name="label">Email</ui:define>
                <h:inputText id="email" value="#{newUser.emailAddress}"
                             required="true"/>
            </s:decorate>
            <s:decorate id="usernameField" template="layout/edit.xhtml">
                <ui:define name="label">Username</ui:define>
                <h:inputText id="userName" value="#{newUser.username}"
                             required="true"/>
            </s:decorate>
            <s:decorate id="passwordField" template="layout/edit.xhtml">
                <ui:define name="label">Password</ui:define>
                <h:inputSecret id="password" value="#{passwordBean.password}"
                               required="true"/>
            </s:decorate>
            <s:decorate id="confirmField" template="layout/edit.xhtml">
                <ui:define name="label">Re-enter password</ui:define>
                <h:inputSecret id="password" value="#{passwordBean.confirm}"
                               required="true"/>
            </s:decorate>
            <div style="clear:both"/>
        </rich:panel>

        <div class="actionButtons">
            <h:commandButton id="cancel" value="Cancel" action="home" immediate="true" />
            <h:commandButton id="register" value="register!"
                             action="#{registerAction.register}">
                <s:defaultAction/>
            </h:commandButton>
        </div>
    </h:form>
</ui:define>

</ui:composition>

